package com.igeekhome.controller.api;

import com.igeekhome.pojo.DExpressCompany;
import com.igeekhome.service.IExpressCompanyService;
import com.igeekhome.util.ResultBean;
import com.igeekhome.util.TableResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Romeo
 */
@RestController
@RequestMapping("/api/company")
public class ExpressCompanyControllerApi {

    @Autowired
    private IExpressCompanyService expressCompanyService;

    @RequestMapping("/list")
    public TableResultBean list(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit){

        return expressCompanyService.list(page,limit);
    }
    @RequestMapping("/add")
    public ResultBean add(DExpressCompany expressCompany){
        return expressCompanyService.add(expressCompany);
    }
    @RequestMapping("/edit")
    public ResultBean edit(DExpressCompany expressCompany){
        return expressCompanyService.edit(expressCompany);
    }
    @RequestMapping("/delete")
    public ResultBean delete(String idsStr){
        return expressCompanyService.logicDelete(idsStr);
    }
}
